package com.cn.why.film.filmindex.util;

import java.util.HashMap;

/**
 * 返回值标准
 */
public class Result extends HashMap {
    private static final long serialVersionUID = 1L;
    //请求成功时
    public static Result success(Object object){
        Result result = new Result();
        result.put(ResultEnum.SUCCESS.getCode(),ResultEnum.SUCCESS.getMessage());
        result.put("Json",object);
        return result;
    }

    //请求出现错误
    public static Result error(Object object){
        Result result = new Result();
        result.put(ResultEnum.ERROR.getCode(),ResultEnum.ERROR.getMessage());
        result.put("Json",object);
        return result;
    }

    //没有登录
    public static Result unLogin(Object object){
        Result result = new Result();
        result.put(ResultEnum.UNLOGIN.getCode(),ResultEnum.UNLOGIN.getMessage());
        result.put("Json",object);
        return result;
    }
}
